<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>DEM Visualization Module &mdash; RiverREM 1.0.4 documentation</title>
      <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
      <link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
  <!--[if lt IE 9]>
    <script src="_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
        <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
        <script src="_static/jquery.js"></script>
        <script src="_static/underscore.js"></script>
        <script src="_static/_sphinx_javascript_frameworks_compat.js"></script>
        <script src="_static/doctools.js"></script>
    <script src="_static/js/theme.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="prev" title="REM Module" href="remindex.html" /> 
</head>

<body class="wy-body-for-nav"> 
  <div class="wy-grid-for-nav">
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
            <a href="index.html" class="icon icon-home"> RiverREM
          </a>
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>
        </div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
              <p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="remindex.html">REM Module</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">DEM Visualization Module</a></li>
</ul>

        </div>
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="index.html">RiverREM</a>
      </nav>

      <div class="wy-nav-content">
        <div class="rst-content">
          <div role="navigation" aria-label="Page navigation">
  <ul class="wy-breadcrumbs">
      <li><a href="index.html" class="icon icon-home"></a> &raquo;</li>
      <li>DEM Visualization Module</li>
      <li class="wy-breadcrumbs-aside">
            <a href="_sources/vizindex.rst.txt" rel="nofollow"> View page source</a>
      </li>
  </ul>
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
             
  <section id="dem-visualization-module">
<h1>DEM Visualization Module<a class="headerlink" href="#dem-visualization-module" title="Permalink to this heading"></a></h1>
<p>This module contains a helper class (RasterViz) that is invoked by the REM module to create visualizations.
It can also be used standalone to create customized visualizations of DEM/REM rasters.</p>
<span class="target" id="module-riverrem.RasterViz"></span><dl class="py class">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">riverrem.RasterViz.</span></span><span class="sig-name descname"><span class="pre">RasterViz</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">dem</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">out_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'./'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">out_ext</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'.tif'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">make_png</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">make_kmz</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">docker_run</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">shell</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">cache_dir</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'./.cache'</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz" title="Permalink to this definition"></a></dt>
<dd><p>Handler to produce DEM derivatives/visualizations.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>dem</strong> (<em>str</em>) – path to input DEM, either in GeoTIFF (.tif), ASCII (.asc), or IMG (.img) format.</p></li>
<li><p><strong>out_dir</strong> (<em>str</em>) – output file directory. Defaults to current working directory.</p></li>
<li><p><strong>out_ext</strong> (<em>str</em><em>, </em><em>'.tif'</em><em> or </em><em>'.img'</em>) – extension for output georaster files.</p></li>
<li><p><strong>make_png</strong> (<em>bool</em>) – output a png image of visualizations (EPSG:3857) in addition to a raster in source projection.</p></li>
<li><p><strong>make_kmz</strong> (<em>bool</em>) – output a kmz file (e.g. Google Earth) of visualizations in addition to a raster in source
projection.</p></li>
<li><p><strong>docker_run</strong> (<em>bool</em>) – only if shell=True as well, calls gdal utilities from shell with docker container. Must have the
osgeo/gdal docker container configured locally to use this option.</p></li>
<li><p><strong>shell</strong> (<em>bool</em>) – call gdal utilities from a shell instead of using the Python bindings. May run faster for large files
but can be more difficult to configure GDAL environment outside conda.</p></li>
<li><p><strong>cache_dir</strong> (<em>str</em>) – cache directory</p></li>
</ul>
</dd>
</dl>
<dl class="py method">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz.make_aspect">
<span class="sig-name descname"><span class="pre">make_aspect</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz.make_aspect" title="Permalink to this definition"></a></dt>
<dd><p>Make aspect map from DEM, with aspect at each pixel in degrees [0-360].</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>path to output aspect raster.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz.make_color_relief">
<span class="sig-name descname"><span class="pre">make_color_relief</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">cmap</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">'terrain'</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">log_scale</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz.make_color_relief" title="Permalink to this definition"></a></dt>
<dd><p>Make color relief map from DEM (3 band RGB raster).</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>cmap</strong> (<em>str</em>) – matplotlib or seaborn named colormap to use for making color relief map.
(see <a class="reference external" href="https://matplotlib.org/stable/gallery/color/colormap_reference.html">https://matplotlib.org/stable/gallery/color/colormap_reference.html</a>)</p></li>
<li><p><strong>log_scale</strong> (<em>bool</em>) – bool, makes the colormap on a log scale from zero, so terrain closer to 0 elevation
has greater color variation. Intended to be used for REMs or coastal datasets.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>path to output color-relief raster.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz.make_hillshade">
<span class="sig-name descname"><span class="pre">make_hillshade</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">z</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">1</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">alt</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">45</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">azim</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">315</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">multidirectional</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">False</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz.make_hillshade" title="Permalink to this definition"></a></dt>
<dd><p>Make hillshade raster from the input DEM.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><ul class="simple">
<li><p><strong>z</strong> (<em>float &gt;1</em>) – z factor for exaggerating vertical scale differences (default 1).</p></li>
<li><p><strong>alt</strong> (<em>float</em><em> [</em><em>0-90</em><em>]</em>) – altitude of light source in degrees (default 45).</p></li>
<li><p><strong>azim</strong> (<em>float</em><em> [</em><em>0-360</em><em>]</em>) – azimuth for light source in degrees (default 315).</p></li>
<li><p><strong>multidirectional</strong> (<em>bool</em>) – makes multidirectional hillshade if True, overriding alt and azim.</p></li>
</ul>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><p>path to output hillshade raster.</p>
</dd>
<dt class="field-odd">Return type</dt>
<dd class="field-odd"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz.make_hillshade_color">
<span class="sig-name descname"><span class="pre">make_hillshade_color</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">blend_percent</span></span><span class="o"><span class="pre">=</span></span><span class="default_value"><span class="pre">60</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz.make_hillshade_color" title="Permalink to this definition"></a></dt>
<dd><p>Make a pretty composite hillshade/color-relief image.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><p><strong>blend_percent</strong> (<em>float</em><em> [</em><em>0-100</em><em>]</em>) – Percent weight of hillshdae in blend, color-relief takes opposite weight.</p>
</dd>
</dl>
<p>This method also accepts all arguments of <cite>make_hillshade</cite> and <cite>make_color_relief</cite> if the respective rasters
have not yet been created.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>path to output hillshade-color raster.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz.make_roughness">
<span class="sig-name descname"><span class="pre">make_roughness</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz.make_roughness" title="Permalink to this definition"></a></dt>
<dd><p>Make roughness map from DEM.</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>path to output roughness raster.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
</dd></dl>

<dl class="py method">
<dt class="sig sig-object py" id="riverrem.RasterViz.RasterViz.make_slope">
<span class="sig-name descname"><span class="pre">make_slope</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="headerlink" href="#riverrem.RasterViz.RasterViz.make_slope" title="Permalink to this definition"></a></dt>
<dd><p>Make slope map from DEM, with slope at each pixel in degrees [0-90].</p>
<dl class="field-list simple">
<dt class="field-odd">Returns</dt>
<dd class="field-odd"><p>path to output slope raster.</p>
</dd>
<dt class="field-even">Return type</dt>
<dd class="field-even"><p>str</p>
</dd>
</dl>
</dd></dl>

</dd></dl>

</section>


           </div>
          </div>
          <footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
        <a href="remindex.html" class="btn btn-neutral float-left" title="REM Module" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>&#169; Copyright 2022, Kenneth Larrieu.</p>
  </div>

  Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    provided by <a href="https://readthedocs.org">Read the Docs</a>.
   

</footer>
        </div>
      </div>
    </section>
  </div>
  <script>
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script> 

</body>
</html>